<?php
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'basic';
$return=array();
/*******basic*******/
if($_RQ['op']=='basic'){
	if($_RQ['postdata']){
		$postdata=get_postdata();
		$this->plugin_setting('about',$postdata);
		exi('设置成功');
	}
	$return['item']=$this->plugin_setting('about');
	$htmls=array(
		'type'=>'edit',
		'desc'=>'设置内容',
		'edit'=>array(
			array('type'=>'string','title'=>'标题','name'=>'title'),
			array('type'=>'richtext','title'=>'内容','name'=>'content'),
		),
	);
	$return['htmls']=$htmls;
	exi($return);
}
if($_RQ['op']=='baoxian'){
	if($_RQ['postdata']){
		$postdata=get_postdata();
		$this->plugin_setting('baoxian',$postdata);
		exi('设置成功');
	}
	$return['item']=$this->plugin_setting('baoxian');
	$htmls=array(
		'type'=>'edit',
		'desc'=>'设置内容',
		'edit'=>array(
			array('type'=>'string','title'=>'标题','name'=>'title'),
			array('type'=>'richtext','title'=>'内容','name'=>'content'),
		),
	);
	$return['htmls']=$htmls;
	exi($return);
}
if($_RQ['op']=='qiye'){
	if($_RQ['postdata']){
		$postdata=get_postdata();
		$this->plugin_setting('qiye',$postdata);
		exi('设置成功');
	}
	$return['item']=$this->plugin_setting('qiye');
	$htmls=array(
		'type'=>'edit',
		'desc'=>'设置内容',
		'edit'=>array(
			array('type'=>'string','title'=>'标题','name'=>'title'),
			array('type'=>'richtext','title'=>'内容','name'=>'content'),
		),
	);
	$return['htmls']=$htmls;
	exi($return);
}
if($_RQ['op']=='join'){
	if($_RQ['postdata']){
		$postdata=get_postdata();
		$this->plugin_setting('join',$postdata);
		exi('设置成功');
	}
	$return['item']=$this->plugin_setting('join');
	$htmls=array(
		'type'=>'edit',
		'desc'=>'设置内容',
		'edit'=>array(
			array('type'=>'string','title'=>'标题','name'=>'title'),
			array('type'=>'richtext','title'=>'内容','name'=>'content'),
		),
	);
	$return['htmls']=$htmls;
	exi($return);
}
if($_RQ['op']=='hezuo'){
	if($_RQ['postdata']){
		$postdata=get_postdata();
		$this->plugin_setting('hezuo',$postdata);
		exi('设置成功');
	}
	$return['item']=$this->plugin_setting('hezuo');
	$htmls=array(
		'type'=>'edit',
		'desc'=>'设置内容',
		'edit'=>array(
			array('type'=>'string','title'=>'标题','name'=>'title'),
			array('type'=>'array','title'=>'合作列表','name'=>'content','add_tip'=>'添加一个合作',
									'list'=>array(
										array('type'=>'string','name'=>'title','title'=>'名称'),
										array('type'=>'image','name'=>'img','title'=>'图片'),
										array('type'=>'string','name'=>'url','title'=>'导航链接'),						
									),
									'details'=>array(
										array('type'=>'string','name'=>'title','title'=>'名称'),
										array('type'=>'image','name'=>'img','title'=>'图片'),
										array('type'=>'string','name'=>'url','title'=>'导航链接'),
									)
			),
		),
	);
	$return['htmls']=$htmls;
	exi($return);
}